<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>UDT Reference</title>
</head>

<body>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber1" bgcolor="#99CCFF" bordercolor="#99CCFF">
  <tr>
    <td width="100%"><font face="Verdana" size="2"><i>&nbsp;UDT Reference: UDT 
	Functions</i></font></td>
  </tr>
</table>
<h1 style="margin-bottom: 0"><font face="Verdana" size="4">getoverlappedresult</font></h1>
<p><font face="Verdana" size="2">The <b>getoverlappedresult </b>method retrieves 
the status of an overlapped IO.</font></p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber2" bgcolor="#C0C0C0" bordercolor="#C0C0C0">
  <tr>
    <td width="100%">
    <p style="margin-top: 0; margin-bottom: 0">
    <font face="Courier New" size="1">bool getoverlappedresult(<br>
&nbsp; UDTSOCKET <font color="#FFFFFF">u</font>,<br>
&nbsp; const int&amp; <font color="#FFFFFF">handle</font>,<br>
&nbsp; int&amp; <font color="#FFFFFF">progress</font>,<br>
&nbsp; <a class="synParam" onclick="showTip(this)">const bool&amp; 
	<font color="#FFFFFF">wait</font></a><br>
	);</font></p>
    </td>
  </tr>
</table>
<h4><font face="Verdana" size="2">Parameters</font></h4>
<dl>
	<dt><font face="Verdana" size="2"><i>u</i></font></dt>
	<dd><font face="Verdana" size="2">[in] Handle to a connected socket.</font></dd>
	<dt><font face="Verdana" size="2"><i>handle</i></font></dt>
	<dd><font face="Verdana" size="2">[in] Handle to the overlapped IO.</font></dd>
	<dt><font face="Verdana" size="2"><i>progress</i></font></dt>
	<dd><font face="Verdana" size="2">[out] amount of data sent or received.</font></dd>
	<dt><font face="Verdana" size="2"><i>wait</i></font></dt>
	<dd><font face="Verdana" size="2">[in] indication if the call should wait 
	for the completion of the overlapped IO.</font></dd>
</dl>
<h4><font face="Verdana" size="2">Return Values</font></h4>
<p><font face="Verdana" size="2">If <i>wait</i> is true, <font color="#008000">true</font> is returned 
for a success call - the IO is completed; otherwise <font color="#008000">false</font> is
returned if there are errors. The specific error information can be found by 
<a href="error.htm">getlasterror</a>.</font></p>
<p><font face="Verdana" size="2">If <i>wait</i> is false, <font color="#008000">true</font>
is returned if the IO has been completed. If the IO is still in progress, <font color="#008000">false</font>
is returned, and the number of bytes transferred is indicated in <i>progress</i>.
A returned value of <font color="#008000">false</font> can also indicates
errors, in which case the <i>progress</i> is set to -1.</font></p>
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="table1" bordercolordark="#C0C0C0" bordercolorlight="#C0C0C0" width="100%">
    <tr>
      <th align="center" bgcolor="#C0C0C0" width="133">
		<font face="Verdana" size="2">Error Code</font></th>
      <th align="center" bgcolor="#C0C0C0" width="812"><b>
      <font face="Verdana" size="2">Comment</font></b></th>
    </tr>
    <tr>
      <td width="133">
      <p style="margin-top: 1; margin-bottom: 1"><font face="Verdana" size="1">
        2001</font></td>
      <td width="812">
      <p style="margin-top: 1; margin-bottom: 1"><font face="Verdana" size="1">
		connection is broken before the IO completes.</font></td>
    </tr>
    <tr>
      <td width="133">
      <font face="Verdana" size="1">2002</font></td>
      <td width="812">
      <font face="Verdana" size="1">connection does not exist.</font></td>
    </tr>
    <tr>
      <td width="133">
      <p style="margin-top: 1; margin-bottom: 1"><font face="Verdana" size="1">
		5003</font></td>
      <td width="812">
      <p style="margin-top: 1; margin-bottom: 1"><font face="Verdana" size="1">
		no overlapped IO is associated with the given handle.</font></td>
    </tr>
    <tr>
      <td width="133">
      <p style="margin-top: 1; margin-bottom: 1"><font face="Verdana" size="1">
		5004</font></td>
      <td width="812">
      <p style="margin-top: 1; margin-bottom: 1"><font face="Verdana" size="1">
		<i>u</i> 
		is an invalid UDT socket.</font></td>
    </tr>
    </table>
<H4><font face="Verdana" size="2">Description</font></H4>
<P><font face="Verdana" size="2">The <b>getoverlappedresult </b>method retrieves 
the status of an overlapped IO associated with the handle. If <i>wait</i> is true, this 
method will wait until the IO is completed. Otherwise it returns immediately and 
indicates the IO progress in <i>progress</i>.</font></P>
<P><font face="Verdana" size="2">Note: In the current implementation, IO handle
cannot be verified. If an invalid handle is passed to the call, true is always
returned and the progress will be zero. That is, when this method returns true, the
value of progress is meaningless. On the other hand, if the method returns
false, the value of progress should be check to see if there are errors or the
IO is not completed.</font></P>
<H4><font face="Verdana" size="2">See Also</font></H4>
<P><font face="Verdana" size="2"><b>
<a href="send.htm">send</a>, <a href="recv.htm">recv</a></b></font></P>

</body>

</html>
